Developer Documentation

QuickTime 4 API Documentation

3D Graphics Programming with QuickDraw 3D 1.5.4

Previous | QD3D Book | Overview | Chapter Contents | Next |

Camera Viewport

Labels

ASCII
CameraViewPort
Binary
cmvp ( = 0x636D7670 )

Data Format

Point2D             origin
Float32             width
Float32             height
origin
The origin of the view port of the parent camera. The abscissa and ordinate of this point should lie in the closed interval [-1, 1]. The value in this field is the upper-left corner of the view port.
width
The width of the view port of the parent camera. The value in this field should lie in the half-open interval (0, 2], and should not be greater than the absolute value of the difference between 1 and the abscissa of the origin.
height
The height of the view port of the parent camera. The value in this field should lie in the half-open interval (0, 2], and should not be greater than the difference between -1 and the ordinate of the origin.

Data Size

16

Description

Every camera specifies the dimensions of the largest (rectangular) image that that camera can produce (called the parent image ), either explicitly or implicitly. The parent image may be specified by giving the coordinates of its vertices, by giving the height to width ratio of its sides, or in some other fashion. The camera view port object specifies the subregion of the parent image that is actually to be drawn. The value in the origin field defines the upper left corner of the view port; the values in the other two fields determine the lengths of the sides of the view port.

The default setting specified below sets the view port equal to the parent image. Other settings may be used to clip the parent image to desired specifications.

Camera view port specifications are made in a coordinate system in which the height-to-width ratio of the parent image is one to one, and the coordinates of the upper-left and lower-right corners of that image are (-1, 1) and (1, -1), respectively. The actual height-to-width ratio of the parent image may not be one to one. If not, then view port specifications should be made under the assumption that the view port will be rescaled by the inverse of the height-to-width ratio of the parent image after the view port specifications have been made. Thus, if the height-to-width ratio of the parent image is i/j , and the height-to-width ratio of the image actually to be drawn is i'/j' , then the height-to-width ratio of the rectangle specified in the view port should be i'j/ij' . Any view port having a different height-to-width ratio will result in a distorted image.

Parent Hierarchy

Data.

Parent Objects

View angle aspect camera, view plane camera, orthographic camera. A camera viewport object always has a parent object.

Child Objects

None.

Example

CameraViewPort (
    -0.5 0.5
    1.0
    1.0
)

Default Values

-1 1            # origin at upper left corner of the parent image
2               # width is the entire width of the parent image
2               # height is the entire height of the parent image

© 1997 Apple Computer, Inc.

Previous | QD3D Book | Overview | Chapter Contents | Next |